#include "inching.h"
#include <AT89X52.h>
#define   RCLK   P1_5 
#define   SDATA  P1_6
#define   SCLK   P1_7
unsigned char show[8]={0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80};

void SendData(unsigned char Xdata,unsigned char Ydata)
{
    unsigned char i=0;
	RCLK=0;
    for(i=0;i<8;i++)
    {
    SDATA=Xdata & 0x01;
    SCLK=1;
    SCLK=0;
    Xdata=Xdata>>1;
    }
    
    for(i=0;i<8;i++)
    {
    SDATA=Ydata & 0x01;
    SCLK=1;
    SCLK=0;
    Ydata=Ydata>>1;
	}
    RCLK=1;
}


void inching()
{
      while(1)
    {
    
    unsigned int i=0;
	for (i=0;i<8;i++)
	{
    SendData(show[i],0x81) ;
    Delay();
    Delay();
	}

	for (i=0;i<8;i++)
	{
    SendData(0x7e,show[i]) ;
    Delay();
    Delay();
	}

    
    }
}